Skip to content

Conversation

@mraszyk
Copy link
Contributor

@mraszyk mraszyk commented Dec 4, 2025

This PR refactors the stable memory representation of events in the migration canister to

  • the history of all events in a map indexed by their sequence numbers;
  • the last event for every pair of source and target canisters represented by its index into the history.

Alternatives considered:

  • a single map BTreeMap<CanisterMigrationArgs, Vec<Event>, Memory> - this representation is inefficient if there are (maliciously) many events for a given pair of source and target canisters;
  • a single map BTreeMap<Event, (), Memory> with events sorted by their pairs of source and target canisters - relying on range queries is fragile and introduces substantial complexity for testing.

@mraszyk mraszyk marked this pull request as ready for review December 4, 2025 17:54
@mraszyk mraszyk requested a review from a team as a code owner December 4, 2025 17:54
Co-authored-by: michael-weigelt <122277901+michael-weigelt@users.noreply.github.com>
@mraszyk mraszyk added this pull request to the merge queue Dec 9, 2025
Merged via the queue into master with commit 6d349eb Dec 9, 2025
38 checks passed
@mraszyk mraszyk deleted the mraszyk/migration-cache-last-event branch December 9, 2025 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants